<?php

namespace app\modules\clinical\models;

use Yii;

/**
 * This is the model class for table "excel_fcmte".
 *
 * @property integer $pk_id
 * @property integer $pt_age
 * @property string $pt_history
 * @property integer $lc_order
 * @property integer $lc_zhen_age
 * @property integer $lc_body
 * @property string $lc_body_order
 * @property integer $lc_type
 * @property integer $lc_isMed
 * @property integer $lc_afterMed
 * @property integer $lc_zhen_severe
 * @property integer $lc_xian_age
 * @property string $lc_fazuo
 * @property string $lc_xianzhao
 * @property string $lc_yongyao
 * @property string $lc_youfa
 * @property integer $lc_xian_severe
 * @property integer $lc_mmse
 * @property integer $lc_jiangzhi
 * @property integer $lc_yemang
 * @property integer $lc_piantout
 * @property integer $lc_jizhenl
 * @property integer $lc_better
 * @property integer $lc_hanm_yiyu
 * @property integer $lc_hanm_jiaolv
 * @property integer $bd_jili_lu
 * @property integer $bd_jili_ld
 * @property integer $bd_jili_ru
 * @property integer $bd_jili_rd
 * @property integer $bd_jiz_lu
 * @property integer $bd_jiz_ld
 * @property integer $bd_jiz_ru
 * @property integer $bd_jiz_rd
 * @property integer $bd_fanshe_er
 * @property integer $bd_fanshe_san
 * @property integer $bd_fanshe_rao
 * @property integer $bd_fanshe_xi
 * @property integer $bd_fanshe_huai
 * @property integer $bd_zhen_bin
 * @property integer $bd_zhen_huai
 * @property integer $bd_bingli
 * @property integer $bd_hoffman
 * @property integer $bd_zhangai
 * @property integer $bd_xiazhi_zhen
 * @property integer $bd_xiazhi_wei
 * @property string $bd_zhuiti
 * @property integer $bd_gg_zhibi
 * @property integer $bd_gg_genxi
 * @property integer $bd_gg_romberg
 * @property integer $bd_gg_yizi
 * @property string $bd_shenjing
 * @property integer $bd_weisuo_ji
 * @property integer $bd_gongxing
 * @property string $bd_butai
 * @property integer $bd_weisuo_shi
 * @property integer $bd_sesu
 * @property integer $bd_gouyin
 * @property integer $bd_shiyu
 * @property integer $bd_yanzhen
 * @property string $bd_chidai
 * @property string $bd_else
 * @property string $bd_fayu
 */
class ExcelFcmte extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'excel_fcmte';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['pt_age', 'lc_order', 'lc_zhen_age', 'lc_body', 'lc_type', 'lc_isMed', 'lc_afterMed', 'lc_zhen_severe', 'lc_xian_age', 'lc_xian_severe', 'lc_mmse', 'lc_jiangzhi', 'lc_yemang', 'lc_piantout', 'lc_jizhenl', 'lc_better', 'lc_hanm_yiyu', 'lc_hanm_jiaolv', 'bd_jili_lu', 'bd_jili_ld', 'bd_jili_ru', 'bd_jili_rd', 'bd_jiz_lu', 'bd_jiz_ld', 'bd_jiz_ru', 'bd_jiz_rd', 'bd_fanshe_er', 'bd_fanshe_san', 'bd_fanshe_rao', 'bd_fanshe_xi', 'bd_fanshe_huai', 'bd_zhen_bin', 'bd_zhen_huai', 'bd_bingli', 'bd_hoffman', 'bd_zhangai', 'bd_xiazhi_zhen', 'bd_xiazhi_wei', 'bd_gg_zhibi', 'bd_gg_genxi', 'bd_gg_romberg', 'bd_gg_yizi', 'bd_weisuo_ji', 'bd_gongxing', 'bd_weisuo_shi', 'bd_sesu', 'bd_gouyin', 'bd_shiyu', 'bd_yanzhen'], 'required'],
            [['pt_age', 'lc_order', 'lc_zhen_age', 'lc_body', 'lc_type', 'lc_isMed', 'lc_afterMed', 'lc_zhen_severe', 'lc_xian_age', 'lc_xian_severe', 'lc_mmse', 'lc_jiangzhi', 'lc_yemang', 'lc_piantout', 'lc_jizhenl', 'lc_better', 'lc_hanm_yiyu', 'lc_hanm_jiaolv', 'bd_jili_lu', 'bd_jili_ld', 'bd_jili_ru', 'bd_jili_rd', 'bd_jiz_lu', 'bd_jiz_ld', 'bd_jiz_ru', 'bd_jiz_rd', 'bd_fanshe_er', 'bd_fanshe_san', 'bd_fanshe_rao', 'bd_fanshe_xi', 'bd_fanshe_huai', 'bd_zhen_bin', 'bd_zhen_huai', 'bd_bingli', 'bd_hoffman', 'bd_zhangai', 'bd_xiazhi_zhen', 'bd_xiazhi_wei', 'bd_gg_zhibi', 'bd_gg_genxi', 'bd_gg_romberg', 'bd_gg_yizi', 'bd_weisuo_ji', 'bd_gongxing', 'bd_weisuo_shi', 'bd_sesu', 'bd_gouyin', 'bd_shiyu', 'bd_yanzhen'], 'integer'],
            [['pt_history', 'lc_body_order', 'lc_fazuo', 'lc_xianzhao', 'lc_yongyao', 'lc_youfa', 'bd_zhuiti', 'bd_shenjing', 'bd_butai', 'bd_chidai', 'bd_else', 'bd_fayu'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'pk_id' => 'Pk ID',
            'pt_age' => '发病年龄',
            'pt_history' => '现病史',
            'lc_order' => '早期症状——震颤和癫痫的发作顺序',
            'lc_zhen_age' => '震颤最早发病年龄',
            'lc_body' => '震颤开始的部位',
            'lc_body_order' => '后逐渐累积到何处',
            'lc_type' => '震颤类型',
            'lc_isMed' => '有无用抗癫痫药',
            'lc_afterMed' => '用抗癫痫药后震颤情况',
            'lc_zhen_severe' => '何种情况下引起震颤或使其加重',
            'lc_xian_age' => '癫痫最早发病年龄',
            'lc_fazuo' => '每次发作类型、次数（每次都记录清楚）',
            'lc_xianzhao' => '发作有无先兆',
            'lc_yongyao' => '使用何种药物及控制情况（既往和现在用药情况）',
            'lc_youfa' => '缺少睡眠、声光刺激、疼痛刺激能否诱发发作',
            'lc_xian_severe' => '何种情况下引起癫痫或使其加重',
            'lc_mmse' => '有无认知功能减退——智能障碍MMSE评分',
            'lc_jiangzhi' => '有无周期性僵直状态（即突然出现的短暂不动伴四肢僵硬状态）',
            'lc_yemang' => '夜盲',
            'lc_piantout' => '偏头痛',
            'lc_jizhenl' => '如果有偏头痛的话：是否伴肌阵挛',
            'lc_better' => '肌阵挛和偏头痛都在用抗癫痫药后是否好转',
            'lc_hanm_yiyu' => '汉米尔顿抑郁量表评分',
            'lc_hanm_jiaolv' => '汉米尔顿焦虑量表评分',
            'bd_jili_lu' => '左上肢',
            'bd_jili_ld' => '左下肢',
            'bd_jili_ru' => '右上肢',
            'bd_jili_rd' => '右下肢',
            'bd_jiz_lu' => '左上肢',
            'bd_jiz_ld' => '左下肢',
            'bd_jiz_ru' => '右上肢',
            'bd_jiz_rd' => '右下肢',
            'bd_fanshe_er' => '肱二头肌反射',
            'bd_fanshe_san' => '肱三头肌反射',
            'bd_fanshe_rao' => '桡骨膜',
            'bd_fanshe_xi' => '膝反射',
            'bd_fanshe_huai' => '踝反射',
            'bd_zhen_bin' => '髌阵挛',
            'bd_zhen_huai' => '踝阵挛',
            'bd_bingli' => '病理征',
            'bd_hoffman' => 'Hoffman征',
            'bd_zhangai' => '感觉障碍（有无痛触觉障碍）',
            'bd_xiazhi_zhen' => '下肢振动觉',
            'bd_xiazhi_wei' => '下肢关节位置觉',
            'bd_zhuiti' => '锥体外系',
            'bd_gg_zhibi' => '指鼻试验',
            'bd_gg_genxi' => '跟膝胫试验',
            'bd_gg_romberg' => 'Romberg征',
            'bd_gg_yizi' => '一字步',
            'bd_shenjing' => '植物神经功能检查（有无大小便障碍）',
            'bd_weisuo_ji' => '肌萎缩（近端及远端）',
            'bd_gongxing' => '弓形足',
            'bd_butai' => '步态',
            'bd_weisuo_shi' => '视神经萎缩',
            'bd_sesu' => '视网膜色素变性',
            'bd_gouyin' => '构音障碍',
            'bd_shiyu' => '失语',
            'bd_yanzhen' => '眼震',
            'bd_chidai' => '痴呆（智能检查：包括智力、定向力、记忆力）',
            'bd_else' => '其他：皮肤病变（有无鱼鳞病、干皮病、皮肤色素减退）',
            'bd_fayu' => '生长发育（有无身材矮小、骨骼畸形、脊柱侧弯等）',
        ];
    }

    public function defaultValue()
    {
        return ;
    }

    public static function getParams($type = false, $code = false) {
        $params = [
            'lc_order' => ['震颤早', '癫痫早', '同时', '不清楚'],
            'lc_body' => ['上肢左', '上肢右', '上肢远端', '上肢近端', '下肢左', '下肢右', '下肢远端', '下肢近端', '头部', '躯干'],
            'lc_type' => ['动作性', '姿势性', '静止性', '伴肌痉挛', '早轻晚重', '早重晚轻', '早晚一样', '其他'],
            'lc_afterMed' => ['消失', '减轻', '无变化', '加重'],
            'lc_zhen_severe' => ['情绪压力', '睡眠不足', '运动劳累', '嘈杂环境', '其他', '无'],
            'youwu' => ['1' => '有', '0' => '无'],
            'yizi' => ['不能', '尚可'],
            'jizhangli' => ['增高', '减退', '正常'],
            'jianfan' => ['0', '+', '++', '+++', '++++'],
            'yinyang' => ['阳性', '阴性'],
            'xiazhi_zhen' => ['正常', '减退'],
            'zhibi' => ['稳准', '欠稳准'],
        ];

        if ($code !== false) {
            return ($type) ? $params[$type][$code] : '';
        }

        return ($type) ? $params[$type] : $params;
    }
}
